<?php
	function f620($sql){ // to be refined
		//data handle instance
		//set request
		//define format
		//set format
		//define query string
		//process time
		//process fitler
		$dataHandle = new DataHandle();
		$dataHandle->setRequest("620");

		$action = getValue($_GET['action']);

		if ($action == "getItems"){
			$query = getGroupQuery();
			print($dataHandle->printJSON($sql, $query));
		}
		else{
			$temp = array();
			$temp['error'] = "620: Bad request";
			print(json_encode($temp));
		}

		unset($dataHandle);

	}

	function getGroupQuery(){

		$queryString = "
			SELECT 
				group_id as 'ID',
				name
			FROM usr_Groups";

		return $queryString;
	}
?>